<!--课程模块-->
<template>
  <div>
    <div class="outer">
      <div class="title">
        <span>{{ title }}</span>
        <a @click="Seach">更多<i class="el-icon-d-arrow-right"></i></a>
      </div>
      <ClassesSon :classList="classList"/>
    </div>
  </div>
</template>

<script>
import {postClass} from "@/api/index-api";
import ClassesSon from "@/views/Index/components/ClassesSon";

export default {
  name: "Classes",
  data() {
    return {
      classList: ""
    }
  },
  props: {
    type: String,
    title: String,
    pageSize: String
  },
  components: {
    ClassesSon,
  },
  created() {
    postClass(this.type, this.pageNum, this.pageSize).then(res => {
      // console.log(res.rows)
      this.classList = res.rows
      // console.log(this.classList)
    })
  },
  methods: {
    Seach() {
      this.$router.push({
        path: '/SearchPage',
        query: {
          keyword: '',
          subjectId: '',
          type: this.type,
          courseType: ''
        }
      })
    }
  }
}
</script>

<style scoped lang="less">
.outer {
  font-size: 14px;
  margin-top: 40px;

  .title {
    height: 30px;
    line-height: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8e8;
    text-align: center;

    span {
      font-size: 24px;
    }

    a {
      float: right;
      margin-right: 20px;
      color: #999999;
      text-decoration: none;
    }
  }

}

</style>